chore(deps): switch host transport to @parity/truapi - #23
Conversation
Drop @novasamatech/host-api(-wrapper); bump product-sdk-host to ^0.14.1 and product-sdk-signer to ^0.11.1 (truAPI comes in via product-sdk-host). No source changes required. Refresh level docs that referenced the retired wrapper. Closes paritytech#20
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
@ReinhardHatko can you please review, i dont have access to add you as a reviewer. |
ReinhardHatko
left a comment
There was a problem hiding this comment.
Thanks for this — right change, and the version choices check out. I verified product-sdk-host@0.14.1, product-sdk-signer@0.11.1 and truapi@0.5.1 against the npm registry: those are the current latest, so this isn't bumping to an arbitrary point.
What checks out
- Real dependency-tree win. Dropping the two
@novasamatech/*direct deps removes ~60 transitive packages: all of@polkadot/api@16.5.6,extension-inject,util-crypto/wasm-crypto/wasm-bridge,smoldot+@substrate/connect,nock,mock-socket,node-fetchwith itsfetch-blob/formdata-polyfillchain,bn.js. For a tutorial whose stated goal is first deploy in ~15 minutes, a materially fasternpm installis on-target — and it shrinks the supply-chain surface. - The
bun.lockregeneration fixes pre-existing drift.main'spackage.jsonalready carriedoverrides: { "@polkadot-api/json-rpc-provider": "0.2.0" };main'sbun.lockdid not. This PR re-adds it. That's a fix, not a new pin — worth calling out so it doesn't read as an unexplained addition. - "No source changes needed" is credible — the import surface is only
src/utils.ts:2-7(SignerManager/HostProvider/DevProvider) andsrc/App.tsx:2(isInsideContainerSync). nanoidshifting5.1.11 → 3.3.12at top level is just postcss's copy getting hoisted oncehost-apistopped pulling v5. Nothing insrc/uses it — not a regression.
Two things I'd want before merge
1. A stale runtime requirement the doc sweep missed — docs/levels/level-1-local-challenger.md:35-36
A Polkadot host —
dot.liin a browser, or the Polkadot Desktop app (≥ 0.7.5). The host ships the host-api 0.8.x wire protocol the current SDK targets.
This contradicts the PR's own premise, and it's not just prose — it's a version gate. It tells developers Desktop ≥ 0.7.5 is sufficient. If truapi 0.5.x speaks a different wire protocol than host-api 0.8.x, someone on 0.7.5 hits a host-connect failure on the very first step of Level 1 while the doc confirms their version is fine.
Since this is the doc-sweep PR, this line belongs in it: please verify the actual minimum Desktop version under truapi and update both the version number and the protocol sentence.
2. The one thing that changed is the one thing not exercised
The PR body notes the quest run-through is still pending. That's the gap I'd close before merging, because:
- These are 0.x packages, where minor bumps are breaking by convention — and this is
0.6.3 → 0.11.1(5 minors) and0.8.0 → 0.14.1(6 minors), on precisely the packages that own the host handshake. tsc -b && vite buildexercises none of that path, and there's no test suite or CI in the repo (.github/contains onlycopilot-instructions.md), so "typecheck and build pass" can't cover it.- At-risk surface is specifically
new HostProvider({ productAccount: { dotNsIdentifier, derivationIndex: 0 } })(src/utils.ts:19-21) andisInsideContainerSync().
Suggested minimum: clean npm install → npm run build → Desktop host connect → account select → one signature → one pg deploy. A broken handshake here doesn't degrade the tutorial, it stops Level 1 dead for every attendee.
Worth checking
3. This puts the repo at odds with the SDK skills setup.sh injects every session
setup.sh refetches .claude/skills/ from product-sdk@main at every session start, and those skills still describe the pre-truapi world:
references/gotchas.mdG11 states that@parity/product-sdk-hostre-exportsgetTruApi/getPreimageManagerfrom@novasamatech/host-api-wrapper, and that it "remains as a transitive dep".SKILL.md:37,122,182,309repeat it.truapiappears nowhere in those skills.
After this PR, host-api-wrapper is absent from the tree entirely — so every session hands the assistant two conflicting doc sets, with the stale one refreshed automatically and not editable from here. Could you file an upstream product-sdk issue to update G11 + those SKILL.md lines and link it from this PR? Otherwise the tutorial's own guidance quietly loses to the auto-fetched version.
4. A substitution that may have turned a true warning false — docs/levels/level-4-multiplayer.md:125
Don't go lower-level than
@parity/product-sdk-statement-store(e.g.@parity/truapi's raw statement store)
truapi@0.5.1's only dependencies are @noble/hashes, neverthrow and scale-ts — that profile reads as a wire-protocol codec. host-api-wrapper plausibly did expose a statement-store surface; truapi may not. If it doesn't, this went from a real warning to a nonexistent one. Either confirm truapi exposes it, or just drop the parenthetical — the advice stands without it.
Nits
docs/levels/level-1-local-challenger.md:110-111— the in-place substitution left a ragged wrap (@parity/truapiis shorter than what it replaced); these files are consistently ~80-col prose-wrapped. Worth a reflow.^0.14.1on a 0.x package resolves to<0.15.0, whiledocs/levels/00-overview.md:19-21andlevel-1:45both say "always use the latest — do NOT pin" /npm install <pkg>@latest. Correct today, but given 0.8 → 0.14 in a single bump, the manifest and that advice will diverge again quickly. Not for this PR — but maybe worth a scheduled bump check rather than another manual sweep.- The product-sdk skills recommend
"@polkadot-api/json-rpc-provider": "^0.2.0"(caret); this repo pins exact0.2.0. Pre-existing and harmless, but easy to align while you're here.
Follow-ups, not this PR
bun.lockis committed but npm is the install path..gitignore:6ignorespackage-lock.json, whilesetup.sh:37,README.md:65anddocs/levels/00-overview.md:21all use npm — sobun.lockgoverns nothing developers actually receive. Theoverridesdrift this PR fixes is evidence it rots silently. Either add a minimal CI job (npm install && npm run build, plus abun install --frozen-lockfilecheck if bun is intended) or dropbun.lock.- Cross-repo consistency:
paritytech/Rock-Paper-Scissors— the reference implementation with all four levels working — is still on@novasamatech/host-api@^0.8.10and has no truapi issue open (its #19/#20 mirror this repo's #21/#22, but there's no counterpart to #20). Once this merges, the tutorial and the reference app will be on two different host transports. Worth opening the mirror issue there.
Security
No concerns. @parity/truapi, @parity/result and @parity/product-sdk-errors are first-party; neverthrow and scale-ts were already in the tree. Removing @polkadot/extension-inject drops a browser-extension injection surface the tutorial never used. Net reduction in third-party code.
Summary: correct change, correct versions, good cleanup. Blocking on the Desktop run-through (2) and the level-1:35-36 version gate (1) — both small. 3 and 4 are quick verifications; the rest can trail.
|
Addressed the doc items:
Left the |
Closes #20
Drops
@novasamatech/host-api(-wrapper)and bumpsproduct-sdk-hostto^0.14.1andproduct-sdk-signerto^0.11.1. The host transport is now@parity/truapi, pulled in viaproduct-sdk-host. No source changes needed; level docs referencing the retired wrapper are updated.Typecheck and build pass. Quest run-through in Desktop still pending.